package j2src;

import java.util.Vector;
import beans.VolLanguageDaoHome;
import beans.VolLanguageDaoRemote;
import beans.VolLanguageDto;


public class VolLanguageDaoDelegate {
	private VolLanguageDaoHome volLanguageDaoHome;
    private VolLanguageDaoRemote volLanguageDaoRemote;
    public VolLanguageDaoDelegate() throws Exception {
        initializeVolLanguageHome();
        volLanguageDaoRemote = volLanguageDaoHome.create();
    }
    public Vector getAllVolLanguage(String volId) throws Exception{
    	return volLanguageDaoRemote.getAllVolLanguage(volId);
    }
	public boolean insertVolLanguage(VolLanguageDto efDto) throws Exception{
		return volLanguageDaoRemote.insertVolLanguage(efDto);
	}
	public boolean updateVolLanguage(VolLanguageDto efDto) throws Exception{
		return volLanguageDaoRemote.updateVolLanguage(efDto);
	}
	

    
    private void initializeVolLanguageHome() throws Exception {
        String FACADE_NAME = "VolLanguageDaoBean";
        Class FACADE_CLASS = beans.CodeDetailDaoHome.class;
        if (volLanguageDaoHome == null) {
            try {
                WhiteDaoLocator locator = WhiteDaoLocator.getInstance();
                volLanguageDaoHome = (VolLanguageDaoHome) WhiteDaoLocator.getEjbHome(FACADE_NAME, FACADE_CLASS);
                if (volLanguageDaoHome == null) {
                    throw new Exception("Did not get home for " + FACADE_NAME);
                }
            } catch (WhiteDaoLocatorException e) {
                throw new Exception(e.getMessage());
            }
        }
    }
}
